<?php
namespace My;

use think\Controller;
use think\Session;

class MyClass extends Controller
{
    public function  _initialize()
    {

        $request = request();
        $session = Session::get('name');
//        halt($session);
        $qx = $session['quanxian'];

//        halt($qx);
        $con = $request->controller();
        $fun = $request->action();

        $permission = $con.'/'.$fun;


        if (!in_array($permission,$qx)){
            return $this->error('您没有当前功能的操作权限!');
        }

    }
}